<?php

header("Content-Type:text/html; charset=gb2312");

require_once "./include/common.inc.php";

if (submitcheck("savesubmit"))
{
    if ($uid != 0)
    {
        $savename =  iconv("UTF-8", "gb2312", $savename);
        $information = xkaddslashes(trim($information));
        $query = $db->query("select * from `{$tablepre}save` where `name` = '{$savename}'");
        $recordNum = $db->num_rows($query);
        if ($recordNum != 0)
        {
            include template("alert");
            return ;
        }
	    $result = $db->query("insert into `{$tablepre}save`  (`curriculum`, `uid`, `name` ) values ('{$information}', '{$uid}', '{$savename}')");
        $_SESSION['name'] = $savename;
    }  
}
?>